import {http} from "@/service/http";
import {Role, User, UserRole} from '@/types/user'

const prefix = '/UserRole'


/**
 * 添加rolename
 * @param roleName userId
 * @returns UserInfo
 */
export const createUserRoleByRoleName = (roleName: string) => {
  return http<Role>({
    method: 'Get',
    url: `${prefix}/AddRole`,
    params: {
      roleName
    }
  })
}


/**
 * Page
 * @returns PageList
 * @param loginName
 * @param loginPwd
 */
export const createUserLoginNamePwd = (loginName: string, loginPwd: string) => {
  return http<User>({
    method: 'GET',
    url: `${prefix}/AddUser`,
    params: {
      loginName, loginPwd
    }
  })
}


/**
 * delete
 * @returns
 * @param uid
 * @param rid
 */
export const createUserRoleByUidRid = (uid: number | string, rid: number | string) => {
  return http<UserRole>({
    method: 'GET',
    url: `${prefix}/AddUserRole`,
    params: {
      uid, rid
    }
  })
}




